package com.cyt.work.wb.model.po;

import com.cyt.base.util.BaseUtil;
import com.cyt.base.util.DictCode;
import com.cyt.sys.model.po.SysUser;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

/**
 * 维修记录表-维修记录表实体类
 *
 * @author shengQiang Yu
 * @date 2019-11-28 9:27:55
 */
@Data
@NoArgsConstructor
@Table(name = "cyt_wb_repair_record")
public class WbRepairRecord implements Serializable {

	/**
     * 主键
     */ 
	@Id
	private String id;

	/**
     * applyId
     */ 
	@Column(name = "apply_id")
	private String applyId;

	/**
     * 报修单id
     */ 
	@Column(name = "repair_id")
	private String repairId;

	/**
     * 维修结果:1、处理成功，2、返修
     */ 
	@Column(name = "status")
	private String status;

	/**
     * 备件更换记录
     */ 
	@Column(name = "equip_record")
	private String equipRecord;

	/**
     * 故障报告
     */ 
	@Column(name = "error_record")
	private String errorRecord;

	/**
	 * 服务商id
	 */
	@Column(name = "servicer_id")
	private String servicerId;
	/**
	 * 维修结果
	 */
	@Column(name = "repair_result")
	private String repairResult;
	/**
     * 维修图片
     */ 
	@Column(name = "images")
	private String images;

	/**
     * 维修人id
     */ 
	@Column(name = "repairman_id")
	private String repairmanId;

	/**
     * 维修人名称
     */ 
	@Column(name = "repaiman_name")
	private String repaimanName;

	/**
     * 维修人手机号
     */ 
	@Column(name = "repaiman_phone")
	private String repaimanPhone;

	/**
     * 删除标识
     */ 
	@Column(name = "remove_tag")
	private String removeTag;

	/**
     * 开始时间
     */ 
	@Column(name = "create_time")
	private Date createTime;

	/**
     * 创建人
     */ 
	@Column(name = "create_user")
	private String createUser;

	/**
     * 结束时间
     */ 
	@Column(name = "update_time")
	private Date updateTime;

	/**
     * 修改人
     */ 
	@Column(name = "update_user")
	private String updateUser;

	/**
	 * 创建对象
	 *
	 * @param sysUser 当前用户信息
	 * @author shengQiang Yu
	 * @date 2019-11-28 9:27:55
	 */
	public WbRepairRecord(SysUser sysUser) {
		this.id = BaseUtil.uId();
		this.removeTag = DictCode.BASE_REMOVE_TAG_NORMAL;
		this.createTime = new Date();
		this.updateTime = new Date();
		if(sysUser!=null){
			this.createUser = sysUser.getId();
			this.updateUser = sysUser.getId();
		}

	}
}